#ifndef BSP_USART_H
#define BSP_USART_H

#include "usart.h"
#include "usb_cmd.h"



typedef struct{
	uint8_t huart_id;
	UART_HandleTypeDef* huart_use;
    uint8_t now_recv_buf_id;
	uint8_t recv_buf[2][256];
    bool tx_dma_if;
    bool rx_dma_if;
    bool init_if;
}Usart_handle;

extern Usart_handle huart1_usart_handle;

void usart_init(Usart_handle* usart_handle, UART_HandleTypeDef* huart_use, uint8_t id, bool tx_use_dma_if);
void usart_rx_isr_handle(Usart_handle* usart_handle, uint8_t use_buf_id, uint16_t recv_len);
void usart_callback(Usart_handle* usart_handle);
void huart_send(Usart_handle* usart_handle, uint8_t* tx_buf, uint16_t data_len);


#endif
